:root{
    --bg:#fefefe;
    --font-light:#555555;
    --font-dark:#333333;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100svh;
    background: linear-gradient(#2196f3, #e91e63);
    overflow:hidden
}
.wrapper{
    position: relative;
    width: 400px;
    aspect-ratio: 4/5;
    /*定义元素宽高比*/
}
.form-wrapper{
    will-change: transform, opacity;
    backface-visibility: hidden; /* 防止旋转时闪烁 */
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg);
    box-shadow: 0 0 10px rgba(0,0,0,0.2);/*阴影效果*/
}

.wrapper.animate-signin .form-wrapper.sign-in{
    animation: animate-signin 1.5s ease-in-out forwards;
}
@keyframes animate-signin {
    0%{
        transform: translateX(0);

    }
    50%{
        transform: translateX(-500px);
    }
    100%{
        transform: translateX(0) rotate(7deg);
    }
}
.wrapper .form-wrapper.sign-up{
    transform: rotate(7deg);
}
.wrapper.animate-signin .form-wrapper.sign-up{
    animation: animate-rotate 0.8s ease-in-out forwards;
    animation-delay: 0.5s;
}
.wrapper.animate-signup .form-wrapper.sign-in{
    transform: rotate(7deg);
    animation: animate-rotate 0.8s ease-in-out forwards;
    animation-delay: 0.5s;
}
@keyframes animate-rotate {
    0%{
        transform: rotate(7deg);
    }
    100%{
        transform:rotate(0);
        z-index: 1;
    }
}
.wrapper.animate-signup .form-wrapper.sign-up{

    animation: animate-signup 1.5s ease-in-out forwards;
}
@keyframes animate-signup{
    0%{
        transform: translateX(0);
        z-index: 1;
    }
    50%{
        transform: translateX(500px);
    }
    100%{
        transform: translateX(0) rotate(7deg);
    }
}
h2{
    font-size: 32px;
    color: var(--font-light);
    text-align: center;
}
.input-group{
    position: relative;
    width: 320px;
    margin: 30px 0;
}
.input-group label{
    position: absolute;
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--font-dark);
    pointer-events: none;
    transition: 0.5s;
}
.input-group input{
    width: 100%;
    height: 40px;
    font-size: 16px;
    color: #333333;
    padding: 0 10px;
    background: transparent;
    border-radius: 5px;
}
.input-group input:focus ~ label,
.input-group input:valid ~ label{
    top: 0;
    font-size: 12px;
    background: var(--bg);
}
.forgot-password{
    color: var(--font-dark);
    font-size: 14px;
    text-decoration: none;
}
.forgot-password a:hover{
    text-decoration: underline;
}
.btn{
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to right,#2196f3,#e91e63);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    font-size: 16px;
    color: var(--bg);
    font-weight: 500;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    outline: none;
}
.sign-link{
    font-size: 14px;
    text-align: center;
    margin: 25px 0;
}
.sign-link p{
    color: var(--font-dark);
}
.sign-link p a{
    color: #e91e63;
    text-decoration: none;
    font-weight: 600;
}
.sign-link p a:hover{
    text-decoration: underline;
}